﻿using System;
using System.Net;
using System.Linq;
#if !WINDOWS_PHONE
using System.Reactive.Linq;
#endif
#if WINDOWS_PHONE
using Microsoft.Phone.Reactive;
#endif

namespace DeepEarth.Core.Utilities
{
	public static class WebRequestHelper
	{
		public static IObservable<string> RequestUrl(string url)
		{
			var request = WebRequest.Create(url);
			return request
				.ToObservable()
				.Select(x => x.GetContentAsString());
		}
	}
}
